// JavaScript Document

var BASE_URL = "http://"+((document.domain.indexOf("www")>-1)?"www.":"")+"domain.com/";
var BASE_URL = "http://192.168.10.119:9090/projects/cms/loly/";
var USER_AGENT = window.navigator.userAgent.toLowerCase();
var IS_OPERA = (USER_AGENT.indexOf("opera")!=-1);
var IS_IE = ((USER_AGENT.indexOf("msie")!=-1)&&((document.all&&!IS_OPERA)));
var IS_MOZILLA = (USER_AGENT.indexOf("gecko")!=-1); //is that right?
var IS_NS = (navigator.appName == "Netscape") ? 1 : 0;

//
//////////////////////////////////////////////////////////////////////////////////////////
/*  Prototype JavaScript framework, version 1.5.2_pre0
 *  (c) 2005-2007 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
/*--------------------------------------------------------------------------*/
var Class = {
	create: function(){
		return function(){
			this.initialize.apply(this, arguments);
		}
	}
}
Object.extend = function(destination, source){
	for (property in source) destination[property] = source[property];
	return destination;
}
Function.prototype.bind = function(object){
	var __method = this;
	return function(){
		return __method.apply(object, arguments);
	}
}
Function.prototype.bindAsEventListener = function(object){
var __method = this;
	return function(event){
		__method.call(object, event || window.event);
	}
}

//////////////////////////////////////////////////////////////////////////////////////////
//extend
//concat, join, pop, push, reverse, shift, slice, sort, splice, unshift
if( !Array.prototype.push ){
	Array.prototype.push = function array_push(){
		for(var i=0;i<arguments.length;i++)
			this[this.length]=arguments[i];
		return this.length;
	}
}
if( !Array.prototype.pop ){
	Array.prototype.pop = function array_pop(){
		lastElement = this[this.length-1];
		this.length = Math.max(this.length-1,0);
		return lastElement;
	}
}
if( !Array.prototype.reverse ){
	Array.prototype.reverse = function array_reverse(){
		var ss = [];
		for(var i=0; i<this.length; i++){
			ss.push(ss[this.length-1-i]);
		}
		
		return ss;
	}
}
Array.prototype.contain = function(value){
	for(var i=0; i<this.length; i++){
		if(this[i] == value) return true;
	}
	return false;
}
Array.prototype.contains = function(value){
	for(var i=0; i<this.length; i++){
		if(this[i] == value || value.contain(this[i])) return true;
	}
	return false;
}
Array.prototype.ins = function(value){
	for(var i=0; i<this.length; i++){
		if(value.contain(this[i]) == false) return false;
	}
	return true;
}
Array.prototype.merge = function(b){
	for(var i=0; i<b.length; i++){
		this.push(b[i]);
	}
	return this;
}
Array.prototype.pushfirst = function(value){
	this.unshift(value);
}
Array.prototype.pushfirstb = function(value){
	var ss = [];
	ss.push(value);
	for(var i=0; i<this.length; i++){
		ss.push(this[i]);
	}
	return ss;
}
Array.prototype.first = function(value){
	if( this.length == 0 ) return null;
	return this[0];
}
Array.prototype.last = function(value){
	if( this.length == 0 ) return null;
	return this[this.length-1];
}

//////////////////////////////////////////////////////////////////////////////////////////
//VERSION 1.0.0.1
function $_(el, d){
	if( isUndefined(d) ){
		d = document;
	}
	if( d.getElementById ){
		return d.getElementById(el);
	} else if( d.all ){
		return d.all[el];
	} else if( d.layers ){
		return d.layers[el];
	} else {
		return null;
	}
}
function $A(a){
	var na = [];
	for(var i=0; i<a.length; i++){
		na.push(a[i]);	
	}
	return na;
}
function $E(el){
	if( typeof el == 'string' ){
		el = document.getElementById(el);
	}
	return el;
}
function $N(name, obj){
	if( typeof(obj) == "undefined" ){
		obj = document;
	}
	if( obj.getElementsByTagName(name) ){
		return obj.getElementsByTagName(name);
	} else {
		return null;
	}
}
function $S(){
	if( arguments.length == 1 ){
		return $E(arguments[0]);	
	}
	var elements = [];
	var a = $A(arguments);
	for(var i=0; i<a.length; i++){
		elements.push($E(a[i]));	
	}
	return elements;
}
function isUndefined(variable){
	return typeof variable == 'undefined' ? true : false;
}

//////////////////////////////////////////////////////////////////////////////////////////
function str_trim(string){
	//return string.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "");
	return string.replace(/^\s*/, "").replace(/\s*$/, "");
}
function str_ltrim(string){
	return s.replace(/^\s*/, "");
}
function str_rtrim(string){
	return s.replace(/^\s*/, "");
}
function str_replace_space(string){
	return string.replace(/\s/g, "").replace(/\u3000/g, "");
}
function str_replace(str_search, str_replace, str_subject){
	if( str_length(str_subject) ){
		return str_subject.replace(str_search, str_replace);
	}
}
function str_length(string){
	return string.replace(/[^x00-\xff]/g, "**").length;
}
function getRand(a, b){
	if( a ){
		b = b ? b:0;
		return Math.floor(Math.random()*a + b);
	} else {
		a = new Date();
		return a.getTime();
	}
}
function getNow(){
    var d = new Date();
	if( IS_IE ){
		var year = d.getYear();
	} else {
		var year = d.getFullYear();
	}
    var month = d.getMonth() + 1;
    var day = d.getDate();
	//getHours(), getMinutes(), getTime()
    if( month < 10 ){
		month = "0" + month;
    }
	if( day < 10 ){
		day="0" + day;
	}
	var separator = '-';
	var ys = "-";
	var ms = "-";
	var ds = "-";
	return year+ys+month+ms+day+ds;
}
//////////////////////////////////////////////////////////////////////////////////////////
//	COOKIE
//////////////////////////////////////////////////////////////////////////////////////////
function setCookie(name,value,path,domain,days){
	var strCookie;
	strCookie = name + "=" + value;
	
	//path
	if(!path){
		path = "/";
	}
	strCookie += "; path=" + path;
	
	//timeout
	var expires = "";
	if(days){
		var date = new Date();
		date.setTime(date.getTime() + (days*24*3600*1000));
		var expires = "; expires=" + date.toGMTString();
	}
	strCookie += expires;
	
	//domain
	if(domain){
		strCookie += "; domain=" + domain;
	}
	
	document.cookie = strCookie;
}
function getCookie(name){
	//RegExp
	var r = new RegExp("(^|;|\\s)*"+name+"=([^;]*)(;|$)");
	var m = document.cookie.match(r);
	return (!m ? "" : m[2]);
	
	//indexOf
	var search,offset;
	search = name + "=";
	offset = document.cookie.indexOf(search);
	if(offset != -1){
		offset += search.length;
		end = document.cookie.indexOf(";",offset);
		if(end == -1){
			end = document.cookie.length;
		}
		return unescape(document.cookie.substring(offset,end));
	} else {
		return null;
	}
	
	//Strict,Array
	var search = name + "=";
	var ca = document.cookie.split(";");
	for(var i=0; i<ca.length; i++){
		var c = ca[i];
		while( c.charAt(0) == " "){
			c = c.substring(1,c.length);
		}
		if(c.indexOf(search) == 0){
			return c.substring(search.length,c.length);
		}
	}
	return null;
}
function eraseCookie(name,path,domain){
    var strCookie = name + "=";
	
	//path
    if(!path){
		path = "/";
	}
    strCookie += "; path=" + path;
	
	//domain
	if(domain){
        strCookie += "; domain="+domain;
    }
	
	//timeout
    strCookie += "; expires=Thu,1 Jan 1970 00:00:01 UTC";
	
	//
    if(getCookie(name)){
        document.cookie = strCookie;
    }
	
	//setCookie(name,"",false,false,-1);
	//setCookie(name,"",path,domain,-1);
}
////////////////////////////////////////////////////////////////////////////////////
// 
////////////////////////////////////////////////////////////////////////////////////
function IsAscii(char){
	if( char > 0 && char <= 255 ){
		return true;
	} else {
		return false;
	}
}
function IsNumeric(strString){
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;
	
	for(i = 0; i < strString.length && blnResult == true; i++){
		strChar = strString.charAt(i);
		if(strValidChars.indexOf(strChar) == -1){
			blnResult = false;
		}
	}
	return blnResult;
}
function IsFloat(strString){
	//if( parseFloat(strString) == strString ){
	//	return true;
	//}
	if( parseInt(strString) > 0 ){
		var pattern = /^[0-9]+((\.)[0-9]+)$/;
		if( IsNumeric(strString) == true || IsDecimal(strString) == true || pattern.test(strString) == true ){
			return true;
		}
	}
	return false;
}
function IsDecimal(strString){
	var strPoint = ".";
	var strValidChars = ".0123456789";
	var strChar;
	var blnResult = true;
	var pointNums = 0;
	
	//point nums
	for(i = 0; i < strString.length; i++){
		strChar = strString.charAt(i);
		if( strChar == strPoint ){
			pointNums++;
		}
	}
	if( pointNums != 1 ){
		return false;
	}
	//first char
	if( strString.charAt(0) == strPoint ){
		strString = "0" + strString;
	}
	//valid char
	for(i = 0; i < strString.length && blnResult == true; i++){
		strChar = strString.charAt(i);
		if(strValidChars.indexOf(strChar) == -1){
			blnResult = false;
		}
	}
	return blnResult;
}
function checkEmail(val){
	var emailPattern = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if( emailPattern.test(val) == false ){
		return false;
	} else {
		return true;
	}
}
function validator_form(){
	var has_error = false;
	var has_warning = false;
	var error_startobj = null;
	if(arguments.length > 0 ){
		var formname = arguments[0];
		if( typeof(formname) == "string" && document.forms[formname] ){
			var form = document.forms[formname];
		} else {
			var form = formname;
			formname = form.name;
		}
		if( typeof(form) == "object" ){
			var i;
			var en;
			var ens = Array();
			if( arguments.length == 2 && arguments[1].length > 0 ){
				ens.push(formname);
				for(i=0; i<arguments[1].length; i++){
					ens.push(arguments[1][i]);
				}
			} else {
				ens = arguments;
			}
			for(i=1; i<ens.length; i++){
				en = ens[i];
				if( form.elements[en] && form.elements[en].value == "" ){
					if( error_startobj == null ){
						error_startobj = form.elements[en];
					}
					var msg = en + "_msg";
					if( $E(msg) ){
						$E(msg).style.display = "";
						has_warning = true;
					}
					has_error = true;
				} else if( form.elements[en] && form.elements[en].value != "" ){
					var msg = en + "_msg";
					if( $E(msg) ){
						$E(msg).style.display = "none";
					}
				}
			}
			
			if( has_error ){
				if( has_warning == false ){
					//alert("Please check the form error!");
					alert("The * Indicates Required Fields.\n\nPlease check the form error!");
				}
				if( error_startobj != null && error_startobj.focus ){
					error_startobj.focus();
				}
				return false;
			} else {
				return true;
			}
		} else {
			return false;
		}
		
	} else {
		return true;
	}
	return true;
}
function validator_blur(el){
	//alert(el);
	if( $E(el).value == "" ){
		var msg = el + "_msg";
		if( $E(msg) ){
			$E(msg).style.display = "";
		}
	} else {
		var msg = el + "_msg";
		if( $E(msg) ){
			$E(msg).style.display = "none";
		}
	}
}
function validator_null(el){
	if( $E(el) && $E(el).value == "" ){
		return true;
	}
	return false;
}
////////////////////////////////////////////////////////////////////////////////////
function dmask(percent){
	if( $E("body_mask") ) {
		return false;	
	}
	if( typeof(percent) == "undefined" ){
		percent = 50;
	}
	var element = document.body;
	var objBrother = element.childNodes[0];
	var divObj = document.createElement('DIV');
	
	var ps = getPageSize();
	var width = ps[2];
	var height = ps[3];// + getScrollTop();
	var divObjInnerHTML = '<div style="text-align:center; margin-top:40px;"></div>';
	divObj.setAttribute("id", "body_mask");
	divObj.style.textAlign = "center";
	divObj.style.position = "absolute";
	divObj.style.top = "0px";
	divObj.style.left = "0px";
	divObj.style.opacity = (percent / 100);
	divObj.style.MozOpacity = (percent / 100);
	divObj.style.KhtmlOpacity = (percent / 100);
	divObj.style.filter = "alpha(opacity="+percent+")";
	divObj.style.height = height + "px";
	divObj.style.width = width + "px";
	divObj.style.margin = "0px";
	divObj.style.padding = "0px";
	divObj.style.backgroundColor = "#000000";
	divObj.style.zIndex = "100";
	
	element.insertBefore(divObj, objBrother);
}
function dmaskd() {
	dremove("body_mask");
}
function dremove(el){
	el = $E(el);
	if( el && el.parentNode ){
		el.parentNode.removeChild(el);
	}
}
function dshow(el){
	if( el = $E(el) ){
		$E(el).style.display = "";
	}
}
function dhide(el){
	if( el = $E(el) ){
		$E(el).style.display = "none";
	}
}
function dtoggle(el){
	if( el = $E(el) ){
		if( el.style.display == "" ){
			el.style.display = "none";
		} else {
			el.style.display = "";
		}
	}
}
function dtoggleWithImg(el){
	var element = $E(el);
	if( element ){
		if( element.style.display == "" ){
			element.style.display = "none";
		} else {
			element.style.display = "";
		}
	}
	if( $E(el+"_img") ){
		if( $E(el+"_img").style.display == "" ){
			$E(el+"_img").style.display = "none";
		} else {
			$E(el+"_img").style.display = "";
		}
	}
}
function dswitch(el){
	if( !$E(e+'1') || !$E(e+'2') || !$E(e+'a') ){
		return;
	}
	if( $E(e+'2').style.display == "none" ){
		$E(e+'1').style.display = "none";
		$E(e+'2').style.display = "";
		$E(e+'a').innerHTML = "[hide]"
	} else {
		$E(e+'2').style.display = "none";
		$E(e+'1').style.display = "";
		$E(e+'a').innerHTML = "[...]"
	}
}
function dtabover(i,c,u){
	if( $E(u+i+'h') ){
		if( $E(u+i+'h').className == "c" ){
			$E(u+i+'h').className = "cc";
		} else if( $E(u+i+'h').className == "d" ){
			$E(u+i+'h').className = "dd";
		}
	}
}
function dtabout(i,c,u){
	if( $E(u+i+'h') ){
		if( $E(u+i+'h').className == "cc" ){
			$E(u+i+'h').className = "c";
		} else if( $E(u+i+'h').className == "dd" ){
			$E(u+i+'h').className = "d";
		}
	}
}
function dtabclick(i,c,u){
	for(var j=0; j<c; j++){
		if( $E(u+j+'h') ){
			$E(u+j+'h').className = "d";
		}
		if( $E(u+j+'c') ){
			$E(u+j+'c').style.display = "none";
		}
	}
	$E(u+i+'h').className = "c";
	$E(u+i+'c').style.display = "";
}
function dselect(obj,a,u){
	for(var k in a){
		var el = $E(u+a[k]);
		if( el ){
			if( a[k] == obj.options[obj.selectedIndex].value ){
				el.style.display = '';
			} else {
				el.style.display = 'none';
			}
		}
	}
}
function dzoomtextarea(e, zoom){
	var zoomsize = zoom ? 10 : -10;
	var obj = $E(el);
	if(obj.rows + zoomsize > 0 && obj.cols + zoomsize * 3 > 0){
		obj.rows += zoomsize;
		obj.cols += zoomsize * 3;
	}
}
function dcheckalloption(form, value){
	for(var i = 0; i < form.elements.length; i++){
		var el = form.elements[i];
		if(el.value == value && el.type == 'radio' && el.disabled != true){
			el.checked = true;
		}
	}
}
function dcheckallvalue(form, value, checkall){
	var checkall = checkall ? checkall : 'chkall';
	for(var i = 0; i < form.elements.length; i++){
		var el = form.elements[i];
		if(el.type == 'checkbox' && el.value == value){
			el.checked = form.elements[checkall].checked;
		}
	}
}
function dinArray(valueToCheck, list){
	for(var i=0; i<list.length; i++){
		if( this[i] == valueToCheck ) return true;
	}
	return false;
}
function dhasAttr(el, k){
	if( el.getAttribute(k) ){
		return true;
	}
	return false;
}
function dgetAttr(el, k, s){
	if( el && el.getAttribute && el.getAttribute(k) ){
		var v = el.getAttribute(k);
		if( s && v.indexOf(s) > -1 ){
			return v.substring(v.indexOf(s)+1);
		}
		return v;
	}
	return -1;
}
function dsetAttr(el, k, v){
	if( el && el.setAttribute ){
		el.setAttribute(k, v);
	}
}
function daddClass(el, className){
	dremoveClass(el, className);
	if( el && el.className ){
		el.className += " " + className;
	} else if( el ){
		el.className = className;
	}
}
function dnoClass(el){
	if(!(el && el.className)){
		return true;
	}
	return false;
}
function dhasClass(el, className, t){
	if(!(el && el.className)){
		return;
	}
	if( isUndefined(t) ){
		t = 0;
	}
	var cls = el.className.split(" ");
	var ar = new Array();
	for(var i = cls.length; i > 0;){
		--i;
		for(var j=0; j<className.length; j++){
			if(cls[i] == className[j] && t == 0){
				return true;
			} else if(cls[i].indexOf(className[j]) > -1 && t == 1){
				return true;
			}
		}
	}
	return false;
}
function dhasClasses(el){
	if(!(el && el.className) || arguments.length <= 1){
		return false;
	}
	var classNames = new Array();
	for(var i=1; i<arguments.length; i++){
		classNames.push(arguments[i]);
	}
	var cls = el.className.split(" ");
	var ar = new Array();
	for(var i = cls.length; i > 0;){
		if(dinArray(cls[--i], classNames)){
			return true;
		}
	}
	return false;
}
function dremoveClass(el, className){
	if(!(el && el.className)){
		return;
	}
	var cls = el.className.split(" ");
	var ar = new Array();
	for(var i = cls.length; i > 0;){
		if(cls[--i] != className){
			ar[ar.length] = cls[i];
		}
	}
	el.className = ar.join(" ");
}
function dsetClassName(e, className){
	if( e.className == "" ){
		e.className = className;
		return;
	}
	if( e.className.indexOf("\""+className+"\"") > -1 || e.className.indexOf("\""+className+"\" ") > -1 || e.className.indexOf(" "+className+"\"") > -1 || e.className.indexOf(" "+className+" ") > -1 ){
		return;
	} else {
		e.className = e.className + " " + className;
	}
}
function dremoveClassName(e, className){
	e.className = e.className.replace(new RegExp("/"+className+"/", "g"), "");
}
function dgetStyle(e, p){
	if( e.style && e.style.p ){
		return e.style[p];
	}
}
function dsetStyle(e, p, v){
	if( p == 'opacity' ){
		if(v == 0 && e.style.visibility != "hidden") e.style.visibility = "hidden";
		else if(e.style.visibility != "visible") e.style.visibility = "visible";
		if(window.ActiveXObject) e.style.filter = "alpha(opacity=" + v*100 + ")";
		e.style.opacity = v;
	} else if( p == 'position' || p == 'className' ){
		e.style[p] = v;
	} else {
		e.style[p] = v+"px";
	}
};

////////////////////////////////////////////////////////////////////////
function appendDIV(pObj, divId, className, innerHTML){
	var divObj = document.createElement("DIV");
	if(className) divObj.className = className;
	//divObj.appendChild(document.createTextNode(text));
	if( IS_IE ){
		divObj.id = divId;
	} else {
		divObj.setAttribute("id", divId);
	}
	with(divObj.style){
		//display = 'none';
		position = 'absolute';
	}
	divObj.innerHTML = innerHTML;
	
	pObj.appendChild(divObj);
	
	return divObj;
}
function appendDIVHTML(divId, innerHTML, className){
	var divObj = document.createElement('DIV');
	
	if( IS_IE ){
		divObj.id = divId;
	} else {
		divObj.setAttribute("id", divId);
	}
	if(className) divObj.className = className;
	with(divObj.style){
		display = 'none';
		position = 'absolute';
	}
	divObj.innerHTML = innerHTML;
	document.body.appendChild(divObj);
	
	return divObj;
}
//
function isWindows(){
	if( navigator.appName.indexOf("Microsoft") != -1 ) return true;
	return false;
}
function isNetscape(){
	if( navigator.appName.indexOf("Netscape") != -1 ) return true;
	return false;
}
function getOffsetLeft(el){
	var ol = el.offsetLeft;
	while ((el = el.offsetParent) != null)
		ol += el.offsetLeft;
	return ol;
}
function getOffsetTop(el){
	var ot = el.offsetTop;
	while((el = el.offsetParent) != null)
		ot += el.offsetTop;
	return ot;
}
function getScrollX(){
	var scrOfY = 0;
	if( typeof(window.pageXOffset) == 'number' ){//Netscape
		scrOfY = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ){//DOM
		scrOfY = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ){//IE6
		scrOfY = document.documentElement.scrollLeft;
	}
	return scrOfY;
}
function getScrollY(){
	var scrOfY = 0;
	if( typeof(window.pageYOffset) == 'number' ){//Netscape
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ){//DOM
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ){//IE6
		scrOfY = document.documentElement.scrollTop;
	}
	return scrOfY;
}
var pageWidth = 800;
var pageHeight = 600;
function getPageSize(){
	var windowWidth, windowHeight;
	if( window.innerHeight ){// all except Explorer
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	} else if( document.documentElement && document.documentElement.clientHeight ){// Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if( document.body ){// other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	var xScroll, yScroll;
	if( window.innerHeight && window.scrollMaxY ){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if( document.body.scrollHeight > document.body.offsetHeight ){// all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	// for small pages with total width less then width of the viewport
	if( xScroll > windowWidth ){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	// for small pages with total height less then height of the viewport
	if( yScroll < windowHeight ){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	//
	arrayPageSize = new Array(windowWidth,windowHeight,pageWidth,pageHeight);
	
	return arrayPageSize;
}
function addEvent(obj,xEvent,handler){
	if(obj.addEventListener){
		obj.addEventListener(xEvent,handler,false);
	} else if(obj.attachEvent){
		obj.attachEvent("on" + xEvent,handler);
	} else {
		el["on"+xEvent] = handler;
	}
}
function removeEvent(obj,xEvent,handler){
	if(obj.removeEventListener){
		obj.removeEventListener(xEvent,handler,false);
	} else if(obj.detachEvent){
		try {
			obj.detachEvent('on'+xEvent,handler);
		} catch(e){}
	}
}
function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	} else {
		window.onload = function(){oldonload();func();}
	}
}
function cssJsMenu(el){
	if($E(el)){
		var root = $E(el);
		var a = root.getElementsByTagName("LI");
		
		for(var i=0; i<a.length; i++){
			a[i].onmouseover = function(){
				for(var j=0; j<this.getElementsByTagName("UL").length; j++){
					var elem = this.getElementsByTagName("UL")[j];
					elem.style.position = "absolute";
					elem.style.left = "0px";
					elem.style.top = "27px";
					elem.style.display = "block";
					elem.style.zIndex = "200";
				}
			};
			a[i].onmouseout = function(){
				for(var j=0; j<this.getElementsByTagName("UL").length; j++){
					dhide(this.getElementsByTagName("UL")[j]);
				}
			};
		}
	}
}
function divJsMenu(tm1, tm1s) {
	//
	var tm1 = $E(tm1);
	var tm1s = $E(tm1s);
	tm1s.style.display = "none";
	//
	var tm1d = document.createElement("DIV");
	tm1d.style.position = "absolute";
	tm1d.style.left = getOffsetLeft(tm1)+"px";
	tm1d.style.top = (getOffsetTop(tm1)+30)+"px";
	//tm1d.style.width = "200px";
	//tm1d.style.height = "200px";
	tm1d.innerHTML = "<ul class=hs>"+tm1s.innerHTML+"</ul>";
	tm1d.style.display = "none";
	tm1d.style.zIndex = "1000";
	tm1d.className = "tmhs";
	document.body.appendChild(tm1d);
	//
	tm1d.onmouseover = function() {
		this.style.display = "block";
	};
	tm1d.onmouseout = function() {
		this.style.display = "none";
	};
	tm1.onmouseover = function() {
		tm1d.style.display = "block";
	};
	tm1.onmouseout = function() {
		tm1d.style.display = "none";
	};
}
//
addLoadEvent(function(){
	if( IS_IE ) {
		//divJsMenu('tm1', 'tm1s');
		//divJsMenu('tm2', 'tm2s');
	}
	//
	if(window.top.frames["mainFrame"]){
		var a = document.links;
		for(var i=0; i<a.length; i++) {
			a[i].onmousedown = function() {
				if(this.href.indexOf(BASE_URL) > -1) {
					top.location.hash = this.href.replace(BASE_URL, "");
				}
			};
		}
	}
});
